<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>小米注册</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="${pageContext.servletContext.contextPath}/images/logo.jpg" />
    <title>用户注册</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            width: 100%;
            height: 100%;
            background-color: #F9F9F9;
        }

        #box {
            width: 770px;
            height: 470px;
            background-color: #fff;
            overflow: hidden;
            margin: 0 auto;
            margin-top: 45px;
        }

        #logo {
            width: 49px;
            height: 48px;
            margin: 0 auto;
            background-image: url(${pageContext.servletContext.contextPath}/images/milogo.png);
            background-repeat: no-repeat;
        }

        h1 {
            font-weight: lighter;
            text-align: center;
            margin-top: 30px;
        }

        input[type="text"],
        input[type="password"] {
            width: 294px;
            height: 38px;
            border: 1px solid #E8E8E8;
            position: relative;
            outline-color: #FF6700;
            display: block;
            margin: 0 auto;
            padding-left: 6px;
        }

        #username {
            margin-top: 30px;
        }

        #password {
            margin-top: 6px;
        }

        input[type="submit"] {
            width: 300px;
            height: 38px;
            display: block;
            margin: 0 auto;
            color: white;
            background-color: #FF6700;
            border: none;
            outline: none;
            cursor: pointer;
            margin-top: 28px;
            transition: .3s;
        }

        input[type="button"]:hover {
            box-shadow: 0px 0px 3px 1px #B1A298;
        }

        #protocol {
            text-align: center;
            color: gray;
            font-size: 13px;
            margin-bottom: 20px;
            margin-top: 55px;
        }

        a {
            font-weight: bolder;
            text-decoration: none;
            color: black;
        }

        footer {
            width: 100%;
            height: 90px;
            position: absolute;
            bottom: 0;
            overflow: hidden;
        }

        p {
            text-align: center;
            font-size: 12px;
            color: grey;
        }

        ul {
            width: 300px;
            height: 20px;
            margin: 10px auto;
            display: flex;
            justify-content: space-around;
        }

        li {
            font-size: 14px;
            height: 14px;
            float: left;
            border-right: 1px solid grey;
            list-style: none;
        }

        .copy {
            color: gray;
            line-height: 14px;
            font-weight: normal;
            display: block;
            padding-right: 17px;
        }

        .copy:hover {
            color: #333;
        }

        li:nth-of-type(4) {
            border-right: none;
        }
    </style>
</head>
<body>
<div id="box">
    <div id="logo"></div>
    <h1>注册小米帐号</h1>
    <form method="post" action="${pageContext.servletContext.contextPath}/front_RegUser" id="dian">
        <input type="text" placeholder="请输入你的手机号" name="phone" id="username" class="ipt"><br>
        <input type="password" placeholder="请输入你的密码" name="password" id="password" class="ipt"><br>
        <input type="text" placeholder="请输入验证码" name="code" style="position: absolute;left: 611px;top: 325px;width: 120px">
        <img src="${pageContext.servletContext.contextPath}/kaptcha.jpg" class="Code_img" title="点击切换验证码" style="position: absolute;left: 787px;top: 328px;">
        <p style="color: #ff7142;position: absolute;left: 671px;top: 395px;width: 120px">${regerr}</p>
        <p id="result" style="position: absolute;left: 631px;top: 425px;">温馨提醒:注册成功后请牢记您的账号密码哟~</p>
        <input type="submit" value="立即注册" id="regBtn" style="position: absolute;left: 611px;top: 415px;">
    </form>
    <p id="protocol">已阅读并同意:小米<a href="${pageContext.servletContext.contextPath}/userProtocol">用户协议</a>和<a href="${pageContext.servletContext.contextPath}/userPrivacy">隐私政策</a></p>
</div>
<footer>
    <ul>
        <li><a href="" class="copy">简体</a></li>
        <li><a href="" class="copy">繁体</a></li>
        <li><a href="" class="copy">English</a></li>
        <li><a href="" class="copy">常见问题</a></li>
    </ul>
    <p>小米公司版权所有-京ICP备10046444-
        <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802020134" target="_blank">
        <img src="${pageContext.servletContext.contextPath}/images/ghs.png"></a>京公网安备11010802020134号-京ICP证110507号
    </p>
</footer>
</body>
<script type="text/javascript" src="${pageContext.servletContext.contextPath}/st/front/JS/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $("#dian").submit(function(){
            var phone=$("[name=phone]").val();
            var password=$("[name=password]").val();
            var code=$("[name=code]").val();
            if(phone===""||phone==null){
                $("#result").html("手机号不能为空！");
                return false;
            }else if(password===""||password==null){
                $("#result").html("密码不能为空！");
                return false;
            }else if(code===""||code==null){
                $("#result").html("验证码不能为空！");
                return false;
            }else{
                return true;
            }

        });
        //点击验证码切换
        $(".Code_img").click(function (){
            this.src="${pageContext.servletContext.contextPath}/kaptcha.jpg?d="+new Date();
        });
    });
</script>
</html>
